# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BatchReadFeatureValuesRequest do
  @moduledoc """
  Request message for FeaturestoreService.BatchReadFeatureValues.

  ## Attributes

  *   `bigqueryReadInstances` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQuerySource.t`, *default:* `nil`) - Similar to csv_read_instances, but from BigQuery source.
  *   `csvReadInstances` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CsvSource.t`, *default:* `nil`) - Each read instance consists of exactly one read timestamp and one or more entity IDs identifying entities of the corresponding EntityTypes whose Features are requested. Each output instance contains Feature values of requested entities concatenated together as of the read time. An example read instance may be `foo_entity_id, bar_entity_id, 2020-01-01T10:00:00.123Z`. An example output instance may be `foo_entity_id, bar_entity_id, 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, bar_entity_feature2_value`. Timestamp in each read instance must be millisecond-aligned. `csv_read_instances` are read instances stored in a plain-text CSV file. The header should be: [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp The columns can be in any order. Values in the timestamp column must use the RFC 3339 format, e.g. `2012-07-30T10:43:17.123Z`.
  *   `destination` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureValueDestination.t`, *default:* `nil`) - Required. Specifies output location and format.
  *   `entityTypeSpecs` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BatchReadFeatureValuesRequestEntityTypeSpec.t)`, *default:* `nil`) - Required. Specifies EntityType grouping Features to read values of and settings.
  *   `passThroughFields` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BatchReadFeatureValuesRequestPassThroughField.t)`, *default:* `nil`) - When not empty, the specified fields in the *_read_instances source will be joined as-is in the output, in addition to those fields from the Featurestore Entity. For BigQuery source, the type of the pass-through values will be automatically inferred. For CSV source, the pass-through values will be passed as opaque bytes.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Optional. Excludes Feature values with feature generation timestamp before this timestamp. If not set, retrieve oldest values kept in Feature Store. Timestamp, if present, must not have higher than millisecond precision.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bigqueryReadInstances =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQuerySource.t() | nil,
          :csvReadInstances =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CsvSource.t() | nil,
          :destination =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureValueDestination.t() | nil,
          :entityTypeSpecs =>
            list(
              GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BatchReadFeatureValuesRequestEntityTypeSpec.t()
            )
            | nil,
          :passThroughFields =>
            list(
              GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BatchReadFeatureValuesRequestPassThroughField.t()
            )
            | nil,
          :startTime => DateTime.t() | nil
        }

  field(:bigqueryReadInstances,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQuerySource
  )

  field(:csvReadInstances, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CsvSource)

  field(:destination,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureValueDestination
  )

  field(:entityTypeSpecs,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BatchReadFeatureValuesRequestEntityTypeSpec,
    type: :list
  )

  field(:passThroughFields,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BatchReadFeatureValuesRequestPassThroughField,
    type: :list
  )

  field(:startTime, as: DateTime)
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BatchReadFeatureValuesRequest do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BatchReadFeatureValuesRequest.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BatchReadFeatureValuesRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
